﻿package com.tris.apevision.shapes
{
	import org.cove.ape.CircleParticle;
	import org.cove.ape.WheelParticle;
	import org.papervision3d.core.math.Number2D;
	import org.papervision3d.core.proto.MaterialObject3D;
	import org.papervision3d.objects.primitives.Sphere;
	import org.papervision3d.scenes.Scene3D;
	
	/**
	* ...
	* @author DefaultUser (Tools -> Custom Arguments...)
	*/
	public class AVSpheroid extends WheelParticle
	{
		public var pz:Number;
		
		private var sphere:Sphere;
		
		public function AVSpheroid(scene:Scene3D, material:MaterialObject3D, x:Number=0, y:Number=0, radius:Number=10, fixed:Boolean=false, mass:Number=1, elasticity:Number=1, friction:Number=0, traction:Number=1, segmentsW:int=10, segmentsH:int=10, z:Number=0) 
		{
			super(x, y, radius, fixed, mass, elasticity, friction);
			sphere = new Sphere( material, radius, segmentsW, segmentsH);
			scene.addChild(sphere);
			pz = z;
		}
		
		override public function init():void
		{
			super.init();
			sprite.graphics.clear();
		}
		
		override public function paint():void
		{
			sphere.x = px;
			sphere.y = -py;
			sphere.z = pz;
			sphere.rotationZ = -angle;
		}
		
	}
	
}